package com.seaboxdata.entity;

import com.baomidou.mybatisplus.annotation.TableName;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author
 * @create 2020-07-31 16:03
 **/
@TableName("base_db.data_monitor_result")
public class DataMonitorResult {
    /**
     * 主键id
     */
/*    @TableId(type = IdType.INPUT)
    private String id;*/
    /**
     * $column.comments
     */
    private String monitorDay;
    /**
     * $column.comments
     */
    private String schemeName;
    /**
     * $column.comments
     */
    private String tableName;
    /**
     * $column.comments
     */
    private Date monitorDate;
    /**
     * $column.comments
     */
    private Integer totalCount;
    /**
     * $column.comments
     */
    private String result;

    /**
     * $column.comments
     */
    private Date lastCjsj;

    public String getMonitorDay() {
        return monitorDay;
    }

    public void setMonitorDay(String monitorDay) {
        this.monitorDay = monitorDay;
    }

    public String getSchemeName() {
        return schemeName;
    }

    public void setSchemeName(String schemeName) {
        this.schemeName = schemeName;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Date getMonitorDate() {
        return monitorDate;
    }

    public void setMonitorDate(Date monitorDate) {
        this.monitorDate = monitorDate;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public Date getLastCjsj() {
        return lastCjsj;
    }

    public void setLastCjsj(Object lastCjsj) {
        SimpleDateFormat simpleDateFormat =
                new SimpleDateFormat("yyyy-MM-dd");
        if(lastCjsj != null && lastCjsj instanceof Date){
            this.lastCjsj = (Date) lastCjsj;
        }else if(lastCjsj != null && lastCjsj instanceof String){
            try {
                this.lastCjsj = simpleDateFormat.parse((String)lastCjsj);
            } catch (ParseException e) {
                this.lastCjsj = null;
            }
        }else{
            this.lastCjsj = null;
        }
    }
}
